package com.lx.service.imp;

import com.lx.dao.BaseAdminDao;
import com.lx.dao.imp.AdminDaoMysql;
import com.lx.service.AdminService;

import java.util.Date;

/**
 * @ClassName: AdminServiceImpl
 * @Description:
 * @Date Created in  2021-07-06 10:38
 * @Modified By:
 * @Author: 零巽
 */
public class AdminServiceImpl implements AdminService {
    private static BaseAdminDao adminDao = new AdminDaoMysql();

    /**
     * 更新登录时间和登录ip
     * @param userName 账号
     * @param date 登录时间
     * @param ip 登录ip
     */
    @Override
    public void updateLoginTimeAndIp(String userName, Date date, String ip) {
        adminDao.UpdateLoginTime(userName,date,ip);
    }

    /**
     * 登录功能
     * @param userName 账号
     * @param password 密码
     * @return true表示登录成功
     */
    @Override
    public  boolean login(String userName, String password) {
        return adminDao.Login(userName, password);
    }


}
